const readline = require('readline-sync');

//----- 打断循环
//1.break 打断整个循环
//2.continue 打断本次循环，进入下一循环

for (let i = 0; i < 5; i++) {
    if (i == 3) {
        break;
    }
    console.log('吃包子');
}
console.log('=====');
for (let i = 0; i < 5; i++) {
    if (i == 3) {
        continue;
    }
    console.log(i);
    console.log('吃包子');
}

console.log('请输入一个大于1的整数');
let num = readline.question() - 0;
// 537  1 2  3  4
// 6 
let flag = false;
for (let i = 2; i < num; i++) {
    console.log(i);
    if (num % i == 0) {
        flag = true;
        break;//结束循环
    }
}
if (flag) {
    console.log('不是质数');
} else {
    console.log('是质数');
}


